package com.example.arithmeticleetcode.leetcode.nov;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-11-30 09:31
 **/
public class Demo22 {

    public static void main(String[] args) {

    }

    public int maximumWealth(int[][] accounts) {
        if (accounts == null || accounts.length == 0) return 0;
        int max = Integer.MIN_VALUE;
        for (int i = 0, len = accounts.length; i < len; i++) {
            int sum = 0;
            for (int j = 0, jLen = accounts[i].length; j < jLen; j++) {
                sum += accounts[i][j];
            }
            if (max < sum) {
                max = sum;
            }
        }
        return max;
    }
}
